﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;

[AttributeUsage(AttributeTargets.All)]
public class HelpAttribute : System.Attribute
{
    public readonly string Url;
    public string Topic  //Topic是一个name_parameter
    {
        get
        {
            return Topic;
        }
        set
        {
            Topic = value;
        }
    }
    public HelpAttribute(string url) //url是一个positional_parameters
    {
        this.Url = url;
    }
    private string topic;
}

[HelpAttribute("关于MyClass的信息")]
class MyClass
{

}
namespace _044
{
    internal class Program
    {
        static void Main(string[] args)
        {
            System.Reflection.MemberInfo info = typeof(MyClass);
            object[] attributers = info.GetCustomAttributes(true);
            for(int i=0;i<attributers.Length;i++)
            {
                System.Console.WriteLine(attributers[i]);
            }
            Console.ReadKey();
        }
    }
}
